/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.vivo.material.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.service.TreeService;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.vivo.material.entity.ViMaterialkind;
import com.vivo.material.dao.ViMaterialkindDao;

/**
 * 物料类别Service
 * @author jyangye
 * @version 2017-11-27
 */
@Service
@Transactional(readOnly = true)
public class ViMaterialkindService extends TreeService<ViMaterialkindDao, ViMaterialkind> {

	public ViMaterialkind get(String id) {
		return super.get(id);
	}
	
	public List<ViMaterialkind> findList(ViMaterialkind viMaterialkind) {
		if (StringUtils.isNotBlank(viMaterialkind.getParentIds())){
			viMaterialkind.setParentIds(","+viMaterialkind.getParentIds()+",");
		}
		return super.findList(viMaterialkind);
	}
	
	@Transactional(readOnly = false)
	public void save(ViMaterialkind viMaterialkind) {
		super.save(viMaterialkind);
	}
	
	@Transactional(readOnly = false)
	public void delete(ViMaterialkind viMaterialkind) {
		super.delete(viMaterialkind);
	}
	
}